# Makefile DMC Win.

CC=dmc
LINK=link
LIBR=lib

# -DCARES_SIZEOF_LONG=4 -DCARES_TYPEOF_ARES_SOCKLEN_T=int -DCARES_SIZEOF_ARES_SOCKLEN_T=4 
# -DNATIVE_WINDOWS 
CFLGS =-o -I. -DMSDMC -DCARES_STATICLIB -DCARES_SYMBOL_HIDING -DHAVE_AF_INET6=0 -DHAVE_WINSOCK2_H
# -e -wx -cpp  | -o -cpp

LOBJS =ares_cancel.obj ares_data.obj ares_destroy.obj ares_expand_name.obj ares_expand_string.obj ares_fds.obj \
	ares_free_hostent.obj ares_free_string.obj ares_gethostbyaddr.obj ares_gethostbyname.obj ares_getopt.obj \
	ares_getsock.obj ares_llist.obj ares_mkquery.obj ares_nowarn.obj ares_options.obj ares_parse_aaaa_reply.obj \
	ares_parse_a_reply.obj ares_parse_ns_reply.obj ares_parse_ptr_reply.obj ares_parse_srv_reply.obj ares_parse_txt_reply.obj \
	ares_query.obj ares_search.obj ares_send.obj ares_strcasecmp.obj ares_strdup.obj ares_strerror.obj ares_timeout.obj \
	ares_version.obj ares_writev.obj ares__close_sockets.obj ares__get_hostent.obj ares__read_line.obj ares__timeval.obj \
	bitncmp.obj inet_net_pton.obj inet_ntop.obj ares_getnameinfo.obj ares_process.obj ares_library_init.obj  ares_init.obj

ALL: cares.lib

test: acountry.exe ahost.exe adig.exe test.exe

acountry.exe: acountry.c cares.lib
	$(CC) $(CFLGS) acountry.c -L/+wsock32.lib+Advapi32.lib+cares.lib

ahost.exe: ahost.c cares.lib
	$(CC) $(CFLGS) ahost.c -L/+wsock32.lib+Advapi32.lib+cares.lib

adig.exe: adig.c cares.lib
	$(CC) $(CFLGS) adig.c -L/+wsock32.lib+Advapi32.lib+cares.lib
	
test.exe: ../test.c
	$(CC) $(CFLGS) ../test.c -L/+wsock32.lib+Advapi32.lib+cares.lib

cares.lib: $(LOBJS)
	$(LIBR) -c cares.lib $(LOBJS)

ares_cancel.obj: ares_cancel.c
	$(CC) $(CFLGS) -c ares_cancel.c
ares_data.obj: ares_data.c
	$(CC) $(CFLGS) -c ares_data.c
ares_destroy.obj: ares_destroy.c
	$(CC) $(CFLGS) -c ares_destroy.c
ares_expand_name.obj: ares_expand_name.c
	$(CC) $(CFLGS) -c ares_expand_name.c
ares_expand_string.obj: ares_expand_string.c
	$(CC) $(CFLGS) -c ares_expand_string.c
ares_fds.obj: ares_fds.c
	$(CC) $(CFLGS) -c ares_fds.c
ares_free_hostent.obj: ares_free_hostent.c
	$(CC) $(CFLGS) -c ares_free_hostent.c
ares_free_string.obj: ares_free_string.c
	$(CC) $(CFLGS) -c ares_free_string.c
ares_gethostbyaddr.obj: ares_gethostbyaddr.c
	$(CC) $(CFLGS) -c ares_gethostbyaddr.c
ares_gethostbyname.obj: ares_gethostbyname.c
	$(CC) $(CFLGS) -c ares_gethostbyname.c
	
ares_getnameinfo.obj: ares_getnameinfo.c
	$(CC) $(CFLGS) -c ares_getnameinfo.c
	
ares_getopt.obj: ares_getopt.c
	$(CC) $(CFLGS) -c ares_getopt.c
ares_getsock.obj: ares_getsock.c
	$(CC) $(CFLGS) -c ares_getsock.c
ares_init.obj: ares_init.c
	$(CC) $(CFLGS) -c ares_init.c
ares_library_init.obj: ares_library_init.c
	$(CC) $(CFLGS) -c ares_library_init.c
ares_llist.obj: ares_llist.c
	$(CC) $(CFLGS) -c ares_llist.c
ares_mkquery.obj: ares_mkquery.c
	$(CC) $(CFLGS) -c ares_mkquery.c
ares_nowarn.obj: ares_nowarn.c
	$(CC) $(CFLGS) -c ares_nowarn.c
ares_options.obj: ares_options.c
	$(CC) $(CFLGS) -c ares_options.c
ares_parse_aaaa_reply.obj: ares_parse_aaaa_reply.c
	$(CC) $(CFLGS) -c ares_parse_aaaa_reply.c
ares_parse_a_reply.obj: ares_parse_a_reply.c
	$(CC) $(CFLGS) -c ares_parse_a_reply.c
ares_parse_ns_reply.obj: ares_parse_ns_reply.c
	$(CC) $(CFLGS) -c ares_parse_ns_reply.c
ares_parse_ptr_reply.obj: ares_parse_ptr_reply.c
	$(CC) $(CFLGS) -c ares_parse_ptr_reply.c
ares_parse_srv_reply.obj: ares_parse_srv_reply.c
	$(CC) $(CFLGS) -c ares_parse_srv_reply.c
ares_parse_txt_reply.obj: ares_parse_txt_reply.c
	$(CC) $(CFLGS) -c ares_parse_txt_reply.c
ares_process.obj: ares_process.c
	$(CC) $(CFLGS) -c ares_process.c
ares_query.obj: ares_query.c
	$(CC) $(CFLGS) -c ares_query.c
ares_search.obj: ares_search.c
	$(CC) $(CFLGS) -c ares_search.c
ares_send.obj: ares_send.c
	$(CC) $(CFLGS) -c ares_send.c
ares_strcasecmp.obj: ares_strcasecmp.c
	$(CC) $(CFLGS) -c ares_strcasecmp.c
ares_strdup.obj: ares_strdup.c
	$(CC) $(CFLGS) -c ares_strdup.c
ares_strerror.obj: ares_strerror.c
	$(CC) $(CFLGS) -c ares_strerror.c
ares_timeout.obj: ares_timeout.c
	$(CC) $(CFLGS) -c ares_timeout.c
ares_version.obj: ares_version.c
	$(CC) $(CFLGS) -c ares_version.c
ares_writev.obj: ares_writev.c
	$(CC) $(CFLGS) -c ares_writev.c
ares__close_sockets.obj: ares__close_sockets.c
	$(CC) $(CFLGS) -c ares__close_sockets.c
ares__get_hostent.obj: ares__get_hostent.c
	$(CC) $(CFLGS) -c ares__get_hostent.c
ares__read_line.obj: ares__read_line.c
	$(CC) $(CFLGS) -c ares__read_line.c
ares__timeval.obj: ares__timeval.c
	$(CC) $(CFLGS) -c ares__timeval.c
bitncmp.obj: bitncmp.c
	$(CC) $(CFLGS) -c bitncmp.c
inet_net_pton.obj: inet_net_pton.c
	$(CC) $(CFLGS) -c inet_net_pton.c
inet_ntop.obj: inet_ntop.c
	$(CC) $(CFLGS) -c inet_ntop.c

clean:
	del *.obj
	del *.map
